/*******************************************************************************
 * Copyright (c) 2012 Daniele Parisi.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html
 * 
 * Contributors:
 *     Daniele Parisi
 *     neb.inf@gmail.com
 *     http://www.danieleparisi.com/
 ******************************************************************************/
package org.jxreport.core.views.chart.line;

import java.util.LinkedList;
import java.util.List;

import org.jxreport.core.Table;
import org.jxreport.core.XMLValues;
import org.jxreport.core.views.chart.ChartView;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class LineChartView extends ChartView{// extends HTMLReportView {

	//public enum Marker { MARKER_STYLE };
	protected List<Line> lines = new LinkedList<Line>();

	public LineChartView(Element chartElement, Table table)
	{
		super(chartElement, table);
		
		NodeList nl = chartElement.getElementsByTagName(XMLValues.LINE);
		for(int i = 0 ; i < nl.getLength();i++) {
			Element el = (Element)nl.item(i);
			this.lines.add(new Line(el, table));
		}
	}
	
	/*
	public static ChartView getChartViewByXMLTag(Element chartElement, List<Instances> instances)
	{
		ChartView cv = new ChartView();
		cv.setTitle(XMLUtils.getTextValue(chartElement, XMLValues.TITLE));
		
		NodeList nl = chartElement.getElementsByTagName(XMLValues.LINE);
		for(int i = 0 ; i < nl.getLength();i++) {
			Element el = (Element)nl.item(i);
			cv.lines.add(Line.getLineByXMLTag(el, instances));
		}
		
		return cv;
	}
	*/
	
	/*
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	*/
	public List<Line> getLines() {
		return lines;
	}

	public void setLines(List<Line> lines) {
		this.lines = lines;
	}
}
